// 导航项类型定义
export interface TabbarItem {
  title: string
  icon: string
  path: string
  auth?: boolean // 是否需要登录权限
  show?: boolean // 是否显示
}

// 底部导航配置
export const tabbarConfig: TabbarItem[] = [
  {
    title: '首页',
    icon: 'home-o',
    path: '/',
    show: true
  },
  {
    title: '分类',
    icon: 'apps-o',
    path: '/category',
    show: true
  },
  {
    title: '购物车',
    icon: 'cart-o',
    path: '/cart',
    show: true,
    auth: true
  },
  {
    title: '我的',
    icon: 'user-o',
    path: '/user',
    show: true,
    auth: true
  }
]

// 获取路由标题
export const getRouteTitle = (path: string): string => {
  const item = tabbarConfig.find(item => item.path === path)
  return item?.title || '首页'
}

// 获取需要登录权限的路由
export const getAuthRoutes = (): string[] => {
  return tabbarConfig
    .filter(item => item.auth)
    .map(item => item.path)
}

// 获取可见的导航项
export const getVisibleTabbarItems = (): TabbarItem[] => {
  return tabbarConfig.filter(item => item.show)
} 